<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script  type="text/javascript">
    var a=prompt("请输入您的年龄");
    if (a>=18){
        document.write("<img src='01.jpg' />")
    }else {
        alert("您的年龄太小");
    }
</script>
</body>
</html>